package drds.data_propagate.parse.binlog_event_position_manager;

import drds.data_propagate.common.utils.JsonUtils;
import drds.data_propagate.entry.position.BinLogEventPosition;
import drds.data_propagate.parse.exception.ParseException;


public class ConfigurationServerBinLogEventPositionManager extends AbstractBinLogEventPositionManager {


    public ConfigurationServerBinLogEventPositionManager() {


    }

    @Override
    public BinLogEventPosition getLatestBinLogEventPosition(String taskId) {
        byte[] data = null;
        if (data == null || data.length == 0) {
            return null;
        }

        return JsonUtils.unmarshalFromByte(data, BinLogEventPosition.class);
    }

    @Override
    public void persistBinLogEventPosition(String taskId, BinLogEventPosition binLogEventPosition) throws ParseException {

        byte[] data = JsonUtils.marshalToByte(binLogEventPosition);

    }

}
